import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { id } from 'element-plus/es/locale';

/**
 * 新建工程
 */
export function addEngineering(data:any) {
    return request({
      url: 'engineering',
      method: 'post',
      data:data
    });
}
/**
 * 编辑工程
 */
export function eidtEngineering(data:any) {
    return request({
      url: 'engineering/'+data.id,
      method: 'put',
      data:data
    });
}
/**
 * 工程列表
 */
export function getEngineering(data:any) {
    return request({
      url: 'engineering',
      method: 'get',
      params:data
    });
}
  
/**
 * 删除工程
 */
export function delEngineering(data:any) {
    return request({
      url: 'engineering',
      method: 'delete',
      params:data
    });
}
/**
 * 工程详情
 */
export function getEngineeringDetail(data:any) {
    return request({
      url: 'engineering/'+data.id,
      method: 'get'
    });
}
/**
 * 选择负责人
 */
export function getUserOptions(data:any) {
    return request({
      url: 'user/options',
      method: 'get',
      params:data
    });
}
/**
 * 选择公司/部门
 */
export function getDepartmentOptions(data:any) {
    return request({
      url: 'department/options',
      method: 'get',
      params:data
    });
}

/**
 * 新建进度
 */
export function addEngineeringSchedule(data:any) {
  return request({
    url: 'engineering/schedule',
    method: 'post',
    data:data
  });
}
/**
 * 修改进度
 */
export function eidtEngineeringSchedule(data:any) {
  return request({
    url: 'engineering/schedule/'+data.id,
    method: 'put',
    data:data
  });
}
/**
 * 删除进度
 */
export function delEngineeringSchedule(data:any) {
  return request({
    url: 'engineering/schedule',
    method: 'delete',
    params:data
  });
}
/**
 * 工程进度列表
 */
export function getEngineeringSchedule(data:any) {
  return request({
    url: 'engineering/schedule',
    method: 'get',
    params:data
  });
}
/**
 * 工程进度详情
 */
export function getEngineeringScheduleDetail(data:any) {
  return request({
    url: 'engineering/schedule/'+data.id,
    method: 'get'
  });
}
/**
 * 我负责的工程
 */
export function getMyengineering(data:any) {
  return request({
    url: 'myengineering',
    method: 'get',
    params:data
  });
}


/**
 * 工程合同支付申请-新建申请
 */
export function addEngineeringPayment(data:any) {
  return request({
    url: 'engineering/payment',
    method: 'post',
    data:data
  });
}
/**
 * 工程合同支付申请-编辑
 */
export function updataEngineeringPayment(data:any) {
  return request({
    url: 'engineering/payment/' + data.id,
    method: 'put',
    data:data
  });
}
/**
 * 工程合同支付申请-删除
 */
export function deleteEngineeringPayment(data:any) {
  return request({
    url: 'engineering/payment/' + data.id,
    method: 'delete'
  });
}
/**
 * 工程合同支付申请-列表
 */
export function getEngineeringPaymentList(data:any) {
  return request({
    url: 'engineering/payment',
    method: 'get',
    params:data
  });
}
/**
 * 工程合同支付申请-详情
 */
export function getEngineeringPaymentDetail(data:any) {
  return request({
    url: 'engineering/payment/'+data.id,
    method: 'get'
  });
}
/**
 * 工程合同支付申请-审核列表
 */
export function getEngineeringPaymentCheckList(data:any) {
  return request({
    url: 'engineering/payment/check',
    method: 'get',
	params:data
  });
}
/**
 * 工程合同支付申请-审核
 */
export function pushEngineeringPaymentCheck(data:any) {
  return request({
    url: 'engineering/payment/check/'+data.id,
    method: 'post',
	data:data
  });
}






//资金申请
 /**
  * 企业融资 新增
  */
 export function engineeringFundAdd(data:any) {
   return request({
     url: '/api/engineering/fund',
     method: 'post',
     data: data
   });
 }
 
 /**
  * 企业融资 编辑
  */
 export function engineeringFundEdit(id:any,data:any) {
   return request({
     url: '/api/engineering/fund/' + id ,
     method:'put',
     data:data
   });
 }
 /**
  * 企业融资 列表
  */
 export function engineeringFundList(data:any) {
   return request({
     url: '/api/engineering/fund',
     method: 'get',
     params:data
   });
 }
 /**
  * 企业融资 详情
  */
 export function engineeringFundInfo(data:any) {
   return request({
     url: '/api/engineering/fund/'+ data.id ,
     method: 'get',
 	params:data
   });
 }
 /**
  * 企业融资 删除
  */
 export function engineeringFundDel(data:any) {
   return request({
     url: '/api/engineering/fund/' + data.id,
     method: 'delete',
 	data:data
   });
 }







 /**
  * 发票入账 新增
  */
 export function engineeringInvoiceAdd(data:any) {
   return request({
     url: '/api/engineering/invoice',
     method: 'post',
     data: data
   });
 }
 
 /**
  * 发票入账 编辑
  */
 export function engineeringInvoiceEdit(id:any,data:any) {
   return request({
     url: '/api/engineering/invoice/' + id ,
     method:'put',
     data:data
   });
 }
 /**
  * 发票入账 列表
  */
 export function engineeringInvoiceList(data:any) {
   return request({
     url: '/api/engineering/invoice',
     method: 'get',
     params:data
   });
 }
 /**
  * 发票入账 详情
  */
 export function engineeringInvoiceInfo(data:any) {
   return request({
     url: '/api/engineering/invoice/'+ data.id ,
     method: 'get',
 	params:data
   });
 }
 /**
  * 发票入账 删除
  */
 export function engineeringInvoiceDel(data:any) {
   return request({
     url: '/api/engineering/invoice/' + data.id,
     method: 'delete',
 	data:data
   });
 }



 /**
  * 资金申请审核 列表
  */
 export function engineeringFundCheckList(data:any) {
   return request({
     url: '/api/engineering/fund/check',
     method: 'get',
     params:data
   });
 }
 /**
  * 资金申请审核 审核
  */
 
 export function engineeringFundCheckAdd(data:any) {
   return request({
     url: '/api/engineering/fund/check/'+data.id,
     method: 'post',
     data: data
   });
 }
 
 /**
  * 发票入账 列表
  */

 export function engineeringInvoiceCheckList(data:any) {
   return request({
     url: '/api/engineering/invoice/check',
     method: 'get',
     params:data
   });
 }
 /**
  * 发票入账 审核
  */
 
 export function engineeringInvoiceCheckAdd(data:any) {
   return request({
     url: '/api/engineering/invoice/check/'+data.id,
     method: 'post',
     data: data
   });
 }
 





